<script setup lang="ts">
interface BannerListType {
  picUrl: string;
}
let bannerList = ref<BannerListType[]>([
  { picUrl: "/images/solution/banner-payment1.png" },
]);
onMounted(() => {
  getBanner();
});
const getBanner = async () => {
  const res = await useApi().app.getBanner({
    bannerCategory: "SOLUTION_PAY",
  });
  if (res.data.length) {
    bannerList.value = res.data;
  }
};
const tabActive2 = ref(1);
const tabList2 = ref([
  { label: "收银软件" },
  { label: "合规分账" },
  { label: "API接口" },
]);
const handleClick2 = (key: number) => {
  tabActive2.value = key + 1;
};
</script>

<template>
  <div class="pages">
    <div class="swiper-content">
      <div class="swiper-item-bg"></div>
      <Swiper
        :height="480"
        :pagination="{
          clickable: true,
          clickableClass: 'web-pagination',
        }"
        :modules="[SwiperPagination]"
      >
        <SwiperSlide
          class="banner-item"
          v-for="(item, index) in bannerList"
          :key="index"
          :style="{ backgroundImage: `url(${item.picUrl})` }"
        >
          <div class="content">
            <div class="txt-shadow">
              <h1 class="title" data-aos="fade-up" data-aos-duration="1000">
                智慧支付方案
              </h1>
              <p
                class="desc"
                data-aos="fade-up"
                data-aos-duration="1000"
                data-aos-delay="500"
              >
                科技连接你我 支付改变生活
              </p>
            </div>
          </div>
        </SwiperSlide>
      </Swiper>
    </div>

    <div class="ability">
      <div class="content">
        <h1
          class="ability-title"
          data-aos="fade-up"
          data-aos-once="true"
          data-aos-duration="1000"
          data-aos-delay="200"
        >
          移动支付+
        </h1>
        <h1
          class="ability-desc"
          data-aos="fade-up"
          data-aos-once="true"
          data-aos-duration="1000"
          data-aos-delay="500"
        >
          面向商户提供全方位的聚付服务，支持刷卡、扫码、刷脸及互联网等支付方式，
          满足商户线上线下一体化的支付需求。
        </h1>
        <div class="ability-list">
          <div
            class="aos"
            data-aos="fade-up"
            data-aos-once="true"
            data-aos-duration="600"
            data-aos-delay="100"
          >
            <div class="ability-item">
              <img src="/images/layouts/checked.png" alt="checked" />
              <p>快速接入</p>
            </div>
          </div>
          <div
            class="aos"
            data-aos="fade-up"
            data-aos-once="true"
            data-aos-duration="600"
            data-aos-delay="200"
          >
            <div class="ability-item">
              <img src="/images/layouts/checked.png" alt="checked" />
              <p>安全可靠</p>
            </div>
          </div>
          <div
            class="aos"
            data-aos="fade-up"
            data-aos-once="true"
            data-aos-duration="600"
            data-aos-delay="400"
          >
            <div class="ability-item">
              <img src="/images/layouts/checked.png" alt="checked" />
              <p>方便快捷</p>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="advantage">
      <div class="content">
        <h1 class="advantage-title">支付服务</h1>
        <div class="tab">
          <div
            @mouseenter="handleClick2(key)"
            class="tab-item"
            :class="{ active: tabActive2 === key + 1 }"
            v-for="(item, key) in tabList2"
            :key="key"
          >
            {{ item.label }}
          </div>
        </div>
        <div class="tab-content" v-if="tabActive2 === 1">
          <div class="t-c-l">
            <h1>收银软件</h1>
            <p>PC端、APP端收银，查账、收款、活动营销，满足商家全方位需求。</p>
            <div class="r-btn">
              <NuxtLink to="/register">快速上手接入</NuxtLink>
            </div>
          </div>
          <img
            class="t-c-img animate__animated animate__fadeInUp"
            src="/images/solution/payment-img1.png"
            alt="收银软件"
          />
        </div>
        <div class="tab-content" v-if="tabActive2 === 2">
          <div class="t-c-l">
            <h1>合规分账</h1>
            <p>
              解决各场景下的资金分配方式，帮助商家与上下游完成灵活有序的利益分配。
            </p>
            <div class="r-btn">
              <NuxtLink to="/register">快速上手接入</NuxtLink>
            </div>
          </div>
          <img
            class="t-c-img animate__animated animate__fadeInUp"
            src="/images/solution/payment-img2.png"
            alt="合规分账"
          />
        </div>
        <div class="tab-content" v-if="tabActive2 === 3">
          <div class="t-c-l">
            <h1>API接口</h1>
            <p>快速接入，个性化支付解决方案</p>
            <div class="r-btn">
              <NuxtLink to="/register">快速上手接入</NuxtLink>
            </div>
          </div>
          <img
            class="t-c-img animate__animated animate__fadeInUp"
            src="/images/solution/payment-img3.png"
            alt="API接口"
          />
        </div>
      </div>
    </div>
    <div class="service">
      <div class="content">
        <h1 class="service-title">五大服务体系，全新服务</h1>
        <div class="service-list">
          <div class="service-item">
            <div class="mask"></div>
            <div class="mask2"></div>
            <h6>产品支持</h6>
            <p>百人研发团队，及时反馈</p>
          </div>
          <div class="service-item">
            <div class="mask"></div>
            <div class="mask2"></div>
            <h6>客服支持</h6>
            <p>7*12小时在线服务</p>
          </div>
          <div class="service-item">
            <div class="mask"></div>
            <div class="mask2"></div>
            <h6>市场支持</h6>
            <p>提供新闪产品的活动政策推广</p>
          </div>
          <div class="service-item">
            <div class="mask"></div>
            <div class="mask2"></div>
            <h6>方案支持</h6>
            <p>提供全方位移动支付解决方案支持</p>
          </div>
          <div class="service-item">
            <div class="mask"></div>
            <div class="mask2"></div>
            <h6>培训支持</h6>
            <p>产品解读，产品营销</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.pages {
  .go-btn {
    width: 308px;
    height: 48px;
    background: #e22000;
    border-radius: 4px 4px 4px 4px;
    font-weight: 400;
    font-size: 15px;
    color: #ffffff;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 34px auto;
    img {
      width: 19px;
      height: 9px;
      margin-left: 8px;
    }
  }
  .swiper-content {
    position: relative;
  }
  .swiper-item-bg {
    width: 50%;
    position: absolute;
    left: 0;
    z-index: 1;
    height: 100%;
    background-color: #273083;
    background-size: 100px cover;
    background-position: left;
  }
  .swiper {
    max-width: 1920px;
  }
  .banner-item {
    min-height: 480px;
    background-size: 100% 100%;
    background-position: left;
    background-repeat: no-repeat;
    z-index: 2;
    position: relative;
    .content {
      padding-left: 50px;
      box-sizing: border-box;
      text-align: right;
      .txt-shadow {
        display: inline-block;
        margin-right: 88px;
        margin-top: 134px;
        text-align: center;
      }
      .title {
        font-weight: 700;
        font-size: 56px;
        color: #070a14;
        letter-spacing: 1px;
      }
      .desc {
        margin-top: 12px;
        font-weight: 400;
        font-size: 21px;
        color: #202949;
        margin-top: 20px;
      }
    }
  }
  .ability {
    padding-top: 108px;
    padding-bottom: 178px;
    box-sizing: border-box;
    text-align: center;
    .ability-title {
      font-weight: 700;
      font-size: 42px;
      text-align: center;
      color: #070a14;
    }
    .ability-desc {
      margin-top: 32px;
      font-weight: 400;
      font-size: 18px;
      color: #8b8b8b;
      display: inline-block;
      width: 858px;
      line-height: 34px;
      text-align: center;
    }
    .ability-list {
      margin-top: 64px;
      padding-left: 35px;
      box-sizing: border-box;
      display: flex;
      align-items: center;
      justify-content: space-between;
      .aos {
        margin-right: 65px;
        &:last-child {
          margin-right: 0;
        }
      }
      .ability-item {
        border: 2px solid rgba(0, 0, 0, 0.2);
        width: 330px;
        height: 95px;
        float: left;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease-in-out;
        
        img {
          width: 32px;
          height: 32px;
          position: absolute;
          left: 50%;
          top: -16px;
          margin-left: -16px;
          z-index: 2;
        }
        p {
          font-weight: 700;
          font-size: 24px;
          color: #242424;
          letter-spacing: 1px;
          text-align: center;
        }
        &:hover {
          transform: translateY(-10px);
        }
      }
      &::after {
        content: "";
        display: block;
        clear: both;
      }
    }
  }
  .advantage {
    padding-top: 120px;
    padding-bottom: 139px;
    box-sizing: border-box;
    background-size: cover;
    background-repeat: no-repeat;
    background-image: url("/images/solution/payment-bg1.png");
    .advantage-title {
      font-weight: 700;
      font-size: 42px;
      color: #070a14;
      text-align: center;
    }
    .tab {
      border-bottom: 2px solid rgba(198, 204, 219, 0.5);
      margin-top: 82px;
      .tab-item {
        cursor: pointer;
        width: 33%;
        font-weight: 400;
        font-size: 24px;
        color: #959eae;
        text-align: center;
        float: left;
        padding-top: 20px;
        padding-bottom: 16px;
        position: relative;
        transition: all 0.3s ease;
        &.active {
          font-weight: 600;
          color: #202949;
          padding-top: 14px;
          &::before {
            content: "";
            display: block;
            width: 170px;
            height: 6px;
            background: #e12010;
            position: absolute;
            margin-left: -85px;
            left: 50%;
            top: 0;
          }
        }
        &:last-child {
          &::after {
            display: none;
          }
        }
        &::after {
          content: "";
          display: block;
          height: 30px;
          width: 1px;
          background: #c6ccdb;
          position: absolute;
          right: 0;
          top: 50%;
          margin-top: -15px;
        }
      }
      &::after {
        content: "";
        display: block;
        clear: both;
      }
    }
    .tab-content {
      margin-top: 65px;
      height: 572px;
      position: relative;
      .t-c-l {
        width: 967px;
        height: 572px;
        background-color: #fff;
        padding-left: 48px;
        box-sizing: border-box;
        overflow: hidden;
        h1 {
          font-weight: 600;
          font-size: 32px;
          color: #070a14;
          margin-top: 66px;
          position: relative;
          &::after {
            content: "";
            display: block;
            position: absolute;
            left: 0;
            bottom: -29px;
            width: 30px;
            height: 2px;
            background: #e12010;
          }
        }
        p {
          font-weight: 400;
          font-size: 18px;
          color: #7a7b7f;
          margin-top: 55px;
        }
        .r-btn {
          margin-top: 62px;
          width: 300px;
          height: 76px;
          background: #ffffff;
          border: 2px solid #242424;
          font-weight: 600;
          font-size: 19px;
          color: #242424;
          letter-spacing: 1px;
          text-align: center;
          display: flex;
          align-items: center;
          justify-content: center;
          position: relative;
          cursor: pointer;
          transition: all 0.3s ease-in-out;
          a {
            font-weight: 600;
            font-size: 20px;
            color: #242424;
          }
          &:hover {
            background-color: rgba(0, 0, 0, 0.05);
            &::after {
              transform: translateX(10px);
            }
          }
          &::after {
            content: "";
            display: block;
            transition: transform 0.3s ease-in-out;
            position: absolute;
            right: -40px;
            width: 79px;
            height: 15px;
            background-image: url("/images/layouts/more-btn-arrow2.png");
            background-repeat: no-repeat;
            background-size: 100% 100%;
            z-index: 1;
          }
        }
      }
      .t-c-img {
        width: 530px;
        height: 530px;
        position: absolute;
        right: 0;
        top: 21px;
      }
    }
  }
  .service {
    padding-top: 120px;
    padding-bottom: 150px;
    box-sizing: border-box;
    overflow: hidden;
    .service-title {
      font-weight: 700;
      font-size: 42px;
      color: #070a14;
      text-align: center;
    }
    .service-list {
      margin-top: 108px;
      padding-left: 35px;
      float: left;
      &::after {
        content: "";
        display: block;
        clear: both;
      }
      .service-item {
        width: 338px;
        height: 472px;
        margin-bottom: 66px;
        float: left;
        background-size: cover;
        background-repeat: no-repeat;
        overflow: hidden;
        margin-right: 54px;
        transition: all 0.3s ease;
        position: relative;
        h6 {
          transition: all 0.3s ease;
          font-weight: 400;
          font-size: 20px;
          color: #ffffff;
          text-align: center;
          margin-top: 52px;
          position: relative;
          z-index: 2;
        }
        p {
          transition: all 0.3s ease;
          font-weight: 400;
          font-size: 18px;
          text-align: center;
          color: #ffffff;
          position: relative;
          z-index: 2;
          margin-top: 25px;
        }
        .mask {
          width: 100%;
          height: 100%;
          position: absolute;
          left: 0;
          top: 0;
          z-index: 1;
          background: linear-gradient(
            180deg,
            #000000 0%,
            rgba(0, 0, 0, 0) 100%
          );
          transition: all 0.3s ease;
        }
        .mask2 {
          width: 100%;
          height: 100%;
          position: absolute;
          left: 0;
          top: 0;
          transform: translateY(-530px);
          z-index: 1;
          background: linear-gradient(
            180deg,
            #991600 4%,
            rgba(118, 17, 0, 0) 99%
          );
          transition: all 0.3s ease;
        }
        &:hover {
          transform: scale(1.05);
          transition: all 0.3s ease;
          h6 {
            font-weight: 600;
            transition: all 0.3s ease;
            font-size: 26px;
            z-index: 2;
            position: relative;
          }
          .mask2 {
            transform: translateY(0px);
          }
        }
        &:nth-child(3n) {
          margin-right: 0;
        }
        &:nth-child(1) {
          background-image: url("/images/solution/payment-ys1.png");
        }
        &:nth-child(2) {
          background-image: url("/images/solution/payment-ys2.png");
        }
        &:nth-child(3) {
          background-image: url("/images/solution/payment-ys3.png");
        }
        &:nth-child(4) {
          width: 534px;
          height: 333px;
          background-image: url("/images/solution/payment-ys4.png");
        }
        &:nth-child(5) {
          width: 534px;
          height: 333px;
          background-image: url("/images/solution/payment-ys5.png");
          margin-right: 0;
        }
      }
    }
  }
}
</style>
